#ifndef __BSP_UART_H
#define __BSP_UART_H

#include "LPC17xx.h"
#include "lpc17xx_pinsel.h"
#include "lpc17xx_uart.h"
#include "lpc17xx_timer.h"

#include "bsp_uart.h"
#include "bsp_wdt.h"
extern uint8_t addr;

typedef struct {
	uint16_t rx_len;
	uint8_t rx_buf[1024];
	uint16_t tx_len;
	uint8_t tx_buf[1024];
	uint8_t flag;
} UART_Type;

#define uart0_enable 0
#define uart1_enable 1
#define uart2_enable 0
#define uart3_enable 0

#if uart0_enable
extern UART_Type uart0;

#endif
#if uart1_enable
extern UART_Type uart1;
#endif
#if uart2_enable
extern UART_Type uart2;
#endif
#if uart3_enable
extern UART_Type uart3;
#endif


void bsp_uart1_init(uint32_t bound);
void UART1_Send(uint8_t *ch,uint16_t len);
unsigned int crc16(unsigned char* puchMsg,unsigned char usDataLen);
#endif
